package Lee_code;

import java.util.*;
public class Lee_149 {

    public int maxPoints(int[][] points) {
        int len = points[0].length;
        int max_point=0;
        for(int i=0; i<len; i++)
        {
            //对挨个计算
            HashMap<Double, Integer> hash = new HashMap<>();
            for(int j=0; j<len; j++)
            {
                //计算斜率
                double k = (double) (points[i][1] - points[j][1])/(points[i][0] - points[j][0]);
                hash.put(k, hash.getOrDefault(k, 0)+1);
            }
            max_point = Math.max(Collections.max(hash.values()),max_point);
        }
        return max_point;
    }
    public static void main(String[] args) {

    }
}
